#
# @lc app=leetcode.cn id=119 lang=python3
#
# [119] 杨辉三角 II
#

# @lc code=start
class Solution:
    def getRow(self, rowIndex: int) -> List[int]:
        returnList = [1]
        for i in range(0,rowIndex):
            self.n1Ton2(returnList)
        
        return returnList
        
        
    def n1Ton2(self, listN1):
        
        listN1.append(0)
        num = len(listN1)
        preNum = listN1[0]
        for i in range(1, num):
            newNum = preNum + listN1[i]
            preNum = listN1[i]
            listN1[i] = newNum
# @lc code=end

